﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using DoAnASP;

public partial class uscDangNhapl : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
            
        
    }

    protected void btnDangky_Click(object sender, EventArgs e)
    {
        Response.Redirect("DangKi.aspx");
    }
    protected void btnDangNhap1_Click(object sender, EventArgs e)
    {
        BUS_NhanVien nv = new BUS_NhanVien();
        DTO_NhanVien nv1 = new DTO_NhanVien();
        DAO_NhanVien d = new DAO_NhanVien();
        nv1.Password = txtMatKhau.Text;
        nv1.Username = txttenTruyCap.Text.ToLower();
        bool kt = nv.KiemTraDN(nv1);
        if (kt == true)
        {
            Session["DangDangNhap"] = true;
            Session["KiemTra"] = "true";
            Session["ThanhVien"] = txttenTruyCap.Text.ToLower();
            lbLoi.Visible = false;

            //Response.Redirect(Request.RawUrl);
            Response.Redirect("Trangchu.aspx");
        }
        else
        {
            lbLoi.Visible = true;
            lbLoi.Text = "Sai tên đăng nhập hoạc mật khảu";
        }
      //  Response.Redirect("Trangchu.aspx");
    }
}